package com.ming.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ming.domain.PickAddr;
import com.ming.domain.PickAddr;
import com.ming.sevice.PickAddrService;
import com.ming.sevice.PickAddrService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:何元才
 * @Desc:
 * @data:2021-04-02 17:22
 */
@RestController
@RequestMapping("/shop/pickAddr")
@Api(tags = "自提点管理接口")
public class PickAddrController {

    @Autowired
    private PickAddrService pickAddrService;


    @GetMapping("page")
    @ApiOperation("分页查询自提点")
    @PreAuthorize("hasAuthority('shop:pickAddr:page')")
    public ResponseEntity<Page<PickAddr>> findPickAddrPage(Page<PickAddr> page, PickAddr pickAddr){
        Page<PickAddr> pickAddrPage = pickAddrService.findPickAddrPage(page,pickAddr);
        return ResponseEntity.ok(pickAddrPage);
    }
}
